const { Logistic } = require('@/models/product');
const getLogistics = async (req, res) => {
  const logistics = await Logistic.getLogistics();
  res.json(logistics);
}
const updateLogistics = async (req, res) => {
  const { orderId } = req.params;
  const data = req.body;
  const logistic = await Logistic.updateLogistics(orderId, data);
  res.json(logistic);
}
const addTracking = async (req, res) => {
  const { orderId } = req.params;
  const data = req.body;
  const logistic = await Logistic.addTracking(orderId, data);
  res.json(logistic);
}
const getDelayed = async (req, res) => {
  const { orderId } = req.params;
  const logistic = await Logistic.getDelayed(orderId);
  res.json(logistic);
}

module.exports = {
  getLogistics,
  updateLogistics,
  addTracking,
  getDelayed
}
